package com.example.mobile2030606155byl0506class19work;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class ShowActivity extends AppCompatActivity {

    private TextView tvShowUserName;
    private TextView tvShowPassword;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show);
        initView();
        Intent intent=getIntent();
        //第一种方式
        tvShowUserName.setText(intent.getStringExtra("userName"));
        //第二种方式
        Bundle bundle=intent.getExtras();
        tvShowPassword.setText(bundle.getString("passWord"));
    }

    private void initView() {
        tvShowUserName = findViewById(R.id.tvShowUserName);
        tvShowPassword = findViewById(R.id.tvShowPassword);
    }
}